JAVA_CLASS_NAME=$1
echo "compile and package now..."
export HADOOP_CLASSPATH=${JAVA_HOME}/lib/tools.jar
hadoop com.sun.tools.javac.Main ${JAVA_CLASS_NAME}.java
echo "move local path *.jar to /tmp"
mv *.jar /tmp/
jar cf ${JAVA_CLASS_NAME}.jar ${JAVA_CLASS_NAME}*class
echo "submit ${JAVA_CLASS_NAME}.jar to hadoop..."
hadoop jar ${JAVA_CLASS_NAME}.jar ${JAVA_CLASS_NAME} $2
echo "all done!"
